<?php
if (!isset($_SESSION['logged']) || $_SESSION['level'] != "admin")
    print "<script language='javascript'>
        window.location.href='./?url=404';
        </script>";
else {
?>
<script type="text/javascript" Language="JavaScript">
    <!--
    function Blank_TextField_Validator2()
    {
        // Check the value of the element
        // from the form
        if (document.postform.title.value == ""){
            // If null display and alert box
            alert("Please fill in the title field.");
            // Place the cursor on the field for revision
            document.postform.title.focus();
            // return false to stop further processing
            return (false);
        }
        // If text_name is not null continue processing
        return (true);
    }
    -->
</script>
<div id="mainCol" class="clearfix">
    <h3 id="why">Add new type</h3>
    <ul id="maincon">
        <li class="clearfix last">
            <fieldset id="forms">
            <table width="100%">
                <form method="post" name="postform" action="?url=typeadding" onsubmit="return Blank_TextField_Validator2()">
                    <tr>
                        <td valign="top" width="15%"><b>Title:</b></td>
                        <td><input type="text" maxlength="50" name="title" id="f_input" size="55" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input type="submit" id="f_submit" value="Save" /></td>
                    </tr>
                </form>
            </table>
            </fieldset>
        </li>
    </ul>
</div>
<script type="text/javascript" language="javascript">
    document.postform.title.focus();
</script>
<?
}
?>
